<?php
class Customer_Model_CustomerAddressBook
{
 
	private $_table;
	//Initalizing Db Table  
	public function __construct(){
		$this->_table = new Customer_Model_DbTable_CustomerAddressBook();
	}
	public function getDbTable(){
		return $this->_table;
	}
	public function update($row,$type,$customerId){
		$where = $this->_table->getAdapter()->quoteInto("cab_type = ?",$type);
		$where .= $this->_table->getAdapter()->quoteInto(" and customer_id = ?",$customerId);
		return $this->_table->update($row,$where);
	}
	public function getByTypeAndCustomerId($type,$customerId){
		$select = $this->_table->select()->where("cab_type = ?",$type)->where("customer_id = ?",$customerId);
		return $this->_table->fetchRow($select);
	}
}